package com.suxin.splitter.spliter;

import com.google.common.reflect.TypeToken;

/**
 * @author Tang
 * @classname AbstractFixTypeParamSplitter
 * @description [  ]
 * @date 2022/11/8 13:27
 */
public abstract class AbstractFixTypeParamSplitter<P>
        extends AbstractParamSplitter<P> implements SmartParamSplitter<P> {

    private final Class supportType;

    public AbstractFixTypeParamSplitter() {
        TypeToken<P> pTypeToken = new TypeToken<P>(getClass()) {
        };
        this.supportType = pTypeToken.getRawType();
    }

    @Override
    public boolean support(Class<P> paramType) {
        return this.supportType.isAssignableFrom(paramType);
    }

}
